<%@page import="com.bci.pwtz.common.util.SpringUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.bci.pwtz.mysql.model.AdminMenu"%>
<%@ page import="com.bci.pwtz.common.PwtzConstants"%>
<%	
	List<AdminMenu> list = (List<AdminMenu>) PwtzConstants.ADMIN_MENU;
	String currentUrl = request.getRequestURI();
	
%>
<%!
public String getCurrentCssClass(String currentUrl,String className,String url)
{
    if(currentUrl.equals(url))
        return className+"_cur";
    else if(url.equals("/pwtz/admin/web/resource/newslist.jsp") &&( currentUrl.contains("/addnews.jsp") || currentUrl.contains("/updatenews.jsp") ))
        className = "left_tree_dqdw_cur";
    else if(url.equals("/pwtz/admin/web/production/productionlist.jsp") &&( currentUrl.contains("/addproduction.jsp") || currentUrl.contains("/updateproduction.jsp") ))
        className = "left_tree_dqdw_cur";
    return className;
}
%>
<!-- 左侧内容_begin -->
<div class="pwsj_cont_left_box">
   <%if(list!=null && list.size()>0){ 
   	for(int i=0;i<list.size();i++){
   		AdminMenu adminMenu = list.get(i);
   		//out.print(adminMenu.getAdminMenus().size());
   		boolean flag = true;
   		for(int j=0;j<adminMenu.getAdminMenus().size();j++)
   		{
   		 	 AdminMenu menu = adminMenu.getAdminMenus().get(j); 	
	   		 String actionCodes = menu.getActionCode();
	   		   		     
   		}
   		
   		if(flag){
   		%>
   		<div class="left_tree_box">
   		<h2 class="left_tree_title"><%=adminMenu.getMenuText()%></h2>
   		 <div  class="left_tree_cont" style="display: none;">
   		 <%
   			for(int j=0;j<adminMenu.getAdminMenus().size();j++){
   				AdminMenu menu = adminMenu.getAdminMenus().get(j);
   				String[] menuUrlAndClass = menu.getMenuUrl().split(",");
   				Long menuId = menu.getAdminMenuId();
   				String actionCodes = menu.getActionCode();
   				/* if(leftAdminRoleService.checkHasActions(request, actionCodes))
   				{ */
   				%>
   				<a  href="<%=menuUrlAndClass[0]%>"<%if(menuId==203) {%> target="_blank"<%} %> class="<%=getCurrentCssClass(currentUrl,menuUrlAndClass[1],menuUrlAndClass[0])%>"><%=menu.getMenuText() %></a>
   				<%
   				//}
   			}
   			%>
   			</div>
   			</div>
   			<%
   		}
   	} 
   }%>
</div>
<!-- 左侧内容_end -->
<script type="text/javascript">
$(function(){
	$("a[class $= '_cur']").parent().show();
});
</script>
